<template>
  <view class="search-container" :style="{'backgroundColor':bgColor}" @click="handleClick">
    <view class="icon-text" :style="{'borderRadius':radius+'px'}">
      <uni-icons type="search" size="17"></uni-icons>
      <text>搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name: "my-search",
    props: {
      bgColor: {
        type: String,
        default: '#f73131'
      },
      radius: {
        type: Number,
        default: 20
      }
    },
    data() {
      return {

      };
    },
    methods: {
      handleClick() {
        this.$emit('click');
      }
    }
  }
</script>

<style lang="scss">
  .search-container {
    height: 50px;
    display: flex;
    align-items: center;

    .icon-text {
      margin: 0 10px;
      height: 68rpx;
      background-color: #fff;
      border: 1px solid black;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;

      text {
        font-size: 16px;
      }
    }
  }
</style>